# frozen_string_literal: true

class AdminsController < Admin::ApplicationController
  def index
    @users = User.includes(:address).all.order(created_at: :desc).page(params[:page]).per(200)
  end

  def list
    @users = User.includes(:address).where(activated: true).order(created_at: :desc)
    @xls_file_name = Time.new.strftime('%Y-%m-%d %H:%M:%S') + '用户信息表'
    respond_to do |format|
      format.xls { response.headers['Content-Disposition'] = 'attachment; filename="' + @xls_file_name + '.xls"' }
    end
    end
 end
